JBoss Community Archive (Read Only)

ModeShape 5

Image files

This sequencer extracts metadata from JPEG, GIF, BMP, PCX, PNG, IFF, RAS, PBM, PGM, PPM and PSD image files. This sequencer extracts the file format, image resolution, number of bits per pixel and optionally number of images, comments and physical resolution, and then writes this information into the repository using the following structure:

<image:metadata node of type image:metadata
        jcr:encoding - optional string property for the encoding of the image
        image:formatName - string property for the name of the format
        image:width - optional integer property for the image's width in pixels
        image:height - optional integer property for the image's height in pixles
        image:bitsPerPixel- optional integer property for the number of bits per pixel
        image:progressive- optional boolean property specifying whether the image is stored in a progressive (i.e., interlaced) form
        image:numberOfImages - optional integer property for the number of images stored in the file; defaults to 1
        image:physicalWidthDpi - optional integer property for the physical width of the image in dots per inch
        image:physicalHeightDpi - optional integer property for the physical height of the image in dots per inch
        image:physicalWidthInches - optional double property for the physical width of the image in inches
        image:physicalHeightInches - optional double property for the physical height of the image in inches
         This structure could be extended in the future to add EXIF and IPTC metadata as child nodes.
         For example, EXIF metadata is structured as tags in directories, where the directories form something like namespaces,
         and which are used by different camera vendors to store custom metadata.
         This structure could be mapped with each directory (e.g. "EXIF" or "Nikon Makernote" or "IPTC") as the name of a child node, with the EXIF tags values stored as either properties or child nodes.
        jcr:mimeType - optional string property for the mime type of the image />

To use this sequencer, simply include the modeshape-sequencer-images JAR in your application and configure the repository in a similar fashion to:

{
    "name" : "Image Sequencer Config",
    "sequencing" : {
        "removeDerivedContentWithOriginal" : true,
        "sequencers" : {
            "Image Sequencer" : {
                "description" : "Images sequencer",
                "classname" : "ImageSequencer",
                "pathExpressions" : [ "default://(*.(gif|png|pict|jpg))/jcr:content[@jcr:data]" ]
            }
        }
    }
}
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:12:58 UTC, last content change 2012-06-19 22:03:54 UTC.